<template>
	<view class="body dd_body chang_hong" >
		<view class="head">
			<view class="head_left" @click="back"><image src="/static/img/fanhui.png" ></image></view>
			<view class="head_center hei_38_bold">兑换记录</view>
			<view class="head_right hei_30"></view>
		</view>
		<view class="content">
			<view class="app_content dd_box">


<!-- 				<view class="qian_24 zanwu" v-if="list.length==0">
					暂无数据
				</view> -->
				<view class="list hui_26">
					<view class="item" v-for="item in list" @click="go('/pages/index/dd_xq?orderid='+item.id)">
						<view class="shang">
							<image :src="item.productiImageUrl?item.productiImageUrl.split(',')[0]:''" mode="" class="xiangmu_img" @click="go_shang(item.goodsid)"></image>
							<view class="shang_right">
								<view class="shang_name hei_28_bold PingFang">
									{{item.productName}}
								</view>
								<view class="hei_24_bold PingFang xiaofei_box">
									
									<view class="xiaofei_rifht">
									
									积分：<text class="hong_28">{{item.points}}</text>
										
									</view>
								</view>
							</view>
						</view>

					</view>
					

				</view>
			</view>
		</view>






	</view>
</template>

<script>
	
	
	
export default {
	data() {
		return {
			img_url: uni.getStorageSync('img_url'),        
			page:1,
			limit:10,
			is_all:false,
			list:[],
		};
	},

	onShow() {
		// this.page = 0;
		// if(this.is_login){
		// 	this.huoqu_list();
		// 	this.get_isreal()
		// }
		
		// // #ifdef MP-ALIPAY
		// my.hideBackHome();
	 //    // #endif
  //      if(uni.getStorageSync('chaxun')){
  //      	   var chaxun=uni.getStorageSync('chaxun')
		//    this.chaxun(chaxun.personOrderId,chaxun.orderid)
  //      }
	},
	onReady() {
		
	},
	mounted() {
		// this.getScrollW();
	},
	onLoad(option) {

		this.get_list();
	},
	//下拉刷新
	onPullDownRefresh: function() {
		this.list = [];
		this.page = 1;
		this.get_list();
	},
	methods: {
		//上拉加载
		onReachBottom() {
			console.log('上拉加载');
			if (this.is_all) {
				uni.showToast({
					title: '没有更多内容了',
					duration: 2000,
					icon: 'none'
				});
				uni.stopPullDownRefresh();
			} else {
				this.page++;
				this.get_list();
			}
		},
		
		go(src,type){
		   uni.navigateTo({
		   	url:src
		   })	
		},
		
		back() {
			uni.navigateBack();
		},
		get_list(){
			this.$http
				.get({
					url: '/api/getOrdersByUserId',
					data: {
						page: this.page,
						limit:this.limit,
						status:2
					}
				})
				.then(res => {
					if (res.code == 200) {
						this.list=this.list.concat(res.list)
						if(res.list.length<this.limit){
							this.is_all=true
						}
					}
				});
		},
	},
	filters: {
		timeStamp: function(value) {
			if (value == null) {
				return 'null';
			}
			var i = (value + '').length;
			while (i++ < 13) value = value + '0';
			value = Number(value);
			var date = new Date(value);
			//date.setTime(value);
			var month = date.getMonth() + 1;
			var hours = date.getHours();
			if (hours < 10) hours = '0' + hours;
			var minutes = date.getMinutes();
			if (minutes < 10) minutes = '0' + minutes;
			// var time = date.getFullYear() + '-' + month + '-' + date.getDate() + ' ' + hours + ':' + minutes;
			var time = date.getFullYear() + '-' + month + '-' + date.getDate() ;
			return time;
		}
	}
};
</script>

<style>
page {
	background-color: #f0f2f5;
}
.head_center {
	width: 80%;
}
.head_right image {
	width: 43rpx;
	height: 38rpx;
}
.head_tab_bottom {
	overflow: auto;
	white-space: nowrap;
	box-sizing: border-box;
}
.head_tab_bottom::-webkit-scrollbar {
	display: none;
}
.head_tab_bottom text {
	margin-right: 50rpx;
	box-sizing: border-box;
	border-bottom: 1px solid #ffffff;
	line-height: 50rpx;
	position: relative;
	font-family: PingFangSCBold;
	display: inline-block;
}
.head_tab_top {
	border: none;
}
.dd_tab {
	display: flex;
	justify-content: space-between;
}
.dd_tab_on {
	
	position: relative;
	color: #6a3906;
	
}
.dd_tab_on::before{
	content: '';
	display: inline-block;
	width:100%;
	height: 4rpx;
	background-color: #6a3906;
	border-radius: 2rpx;
	position: absolute;
	bottom: -16rpx;
}
.dd_tab {
	display: flex;
	justify-content: space-between;
	padding: 0 32rpx 0;
}

.item {
	padding: 0rpx 20rpx 0;
	background-color: #ffffff;
	margin-bottom: 10rpx;
}
.list {
	margin-top: 10rpx;
}

.item_caozuo {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	padding: 20rpx 0 10rpx;
     border-top: 1px dashed #bbb;
}
.item_caozuo button {
	padding: 0 30rpx;
	height: 56rpx;
	background-color: #ffffff;
	border-radius: 28rpx;
	line-height: 56rpx;
	margin-left: 10rpx;
	margin-bottom: 10rpx;
}
.qian_btn{
	border: solid 1px #999999 ;
}
.hong_btn{
	border: solid 1px #6a3906 ;
}

.top_tishi{
	display: flex;
	align-items: center;
	padding: 0 30rpx;
	background-color: #ffe0eb;
	height: 76rpx;
	justify-content: space-between;
}
.top_tishi_left{
	display: flex;
	align-items: center;
}
.top_tishi_left image{
	width: 30rpx;
	height: 30rpx;
	margin-right: 10rpx;
	
}
.top_tishi_left text{
	max-width: 88%;
}
.close{
	width: 18rpx;
	height: 18rpx;
}
.image{
	vertical-align: bottom;
}
.xiangmu_img{
	width: 160rpx;
	height: 160rpx;
	border-radius: 10rpx;
}

.item_top{
	height: 70rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px dashed #bbbbbb;
}
.item_top_left{
	display: flex;
	align-items: center;
}
.item_top_left text{
	margin: 0 10rpx;
}
.item_top_left image{
	width: 20rpx;
	height: 20rpx;
}
.shang{
	display: flex;
	align-items: center;
	padding: 20rpx 0;
	width: 100%;
}
.shang_right{
	margin-left: 20rpx;
	width: 530rpx;
}
.jibie{
	padding: 0 12rpx;
	height: 40rpx;
	line-height: 40rpx;
	background-color: #edfaf5;
}
.shujv{
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 20rpx 0;
	
}
.open_kuaidi{
	width: 688rpx;
	
	background-color: #ffffff;
	border-radius: 5rpx;
	padding: 0 26rpx;
	box-sizing: border-box;
}
.open_kuaidi_title{
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 116rpx;
	border-bottom: 1px solid #ececec;
}
.open_close{
	width: 26rpx;
	height: 26rpx;
	cursor: pointer;
}
.open_kuaidi_tishi{
	margin: 40rpx 0;
}
.open_kuaidi_list{
	width: 560rpx;
	height: 66rpx;
	background-color: #ffffff;
	border-radius: 5rpx;
	border: solid 1rpx #c6c6c6;
	margin-left: 10rpx;
	margin-bottom: 36rpx;
	display: flex;
	align-items: center;
	padding-left: 16rpx;
}
.open_kuaidi_list input{
	border: none;
	width: 100%;
	height: 100%;
}
.open_kuaidi_list:last-child{
	margin-bottom: 0;
}
.open_kuaidi_bottom{
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0rpx 0 40rpx;
}
.open_kuaidi_bottom button{
	width: 214rpx;
	height: 80rpx;
	border-radius: 40rpx;
	line-height: 80rpx;
	text-align: center;
}
.open_kuaidi_bottom button:first-child{
	background-color: #5f3917;
	margin-right: 36rpx;
}
.open_kuaidi_bottom button:last-child{
	background-color: #c6c6c6;
}
.add_danhao_tishi {
	line-height: 44rpx;
	padding: 20rpx 26rpx;
}
.add_gongsi {
	position: relative;
	height: 64rpx;
	background-color: #ffffff;
	border-radius: 4.8rpx;
	width: 100%;
	box-sizing: border-box !important;
	border: solid 1px #c6c6c6;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 10rpx;
	box-sizing: border-box;
}
.add_gongsi image{
	    width: 20rpx;
	    height: 10rpx;
}
.add_gongsi .filter-text {
	height: 64rpx;
	border-radius: 4.8rpx;
	border: solid 1px #c6c6c6;
	box-sizing: border-box !important;
}
.tan_danhao {
	margin: 48rpx 0;
}
.tan_danhao input {
	height: 64rpx;
	background-color: #ffffff;
	border-radius: 4.8rpx;
	border: solid 1px #c6c6c6;
	width: 100%;
	padding-left: 16rpx;
	box-sizing: border-box;
}
.add_danhao{
	width: 688rpx;
	
	background-color: #ffffff;
	border-radius: 5rpx;
	padding: 0 0rpx 20rpx;
	box-sizing: border-box;
}
.add_danhao_center{
	padding: 0 30rpx 0 30rpx;
}
.add_danhao .open_kuaidi_bottom {
	margin-top: 60rpx;
}
.add_danhao .open_kuaidi_bottom button:first-child{
	background-color: #e7246a;
}
.tab-scroll_item{
	word-break: keep-all;
}
.zanwu{
	text-align: center;
	line-height: 80rpx;
}
.shang_name{
	word-break: break-all;
	/* height: 80rpx; */
	margin-bottom: 10rpx;
	overflow:hidden;
	text-overflow:ellipsis;
	display:-webkit-box;
	-webkit-box-orient:vertical;
	-webkit-line-clamp:2; 
}
#tan_quxiao{
	z-index: 999;
}
.tan_quxiao{
	background-color: #ffffff;
	box-shadow: 0rpx 0rpx 27rpx 0rpx 
		rgba(39, 39, 39, 0.2);
	border-radius: 10rpx;
	box-sizing: border-box;
}
.tan_yixia_bottom{
	display: flex;
	align-items: center;
	justify-content: center;
	height: 240rpx;
	padding-bottom: 20rpx;
	box-sizing: border-box;
}
.tan_yixia_bottom button:first-child{
	width: 290rpx;
	height: 80rpx;
	background-color: #e7246a;
	border-radius: 44rpx;
	line-height: 80rpx;
	margin-right: 66rpx;
}
.tan_yixia_bottom button:last-child{
	width: 290rpx;
	height: 80rpx;
	background-color: #cacaca;
	border-radius: 44rpx;
	line-height: 80rpx;
}

.tan_quxiao_list{
	padding: 0 46rpx;
	
}
.tan_quxiao_item{
	display: flex;
	align-items: center;
	margin-top:40rpx ;
}
.tan_yixia_title{
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 128rpx;
	border-bottom: 1px solid #e5e5e5;
	padding: 0 20rpx;
}
.tan_yixia_title image{
	width: 28rpx;
	height: 28rpx;
}
.shiming{
	display: flex;
	align-items: center;
	height: 90rpx;
	border-bottom: 1px dashed #bbbbbb;
}
.shiming image{
	width: 32rpx;
	height: 32rpx;
	margin-right: 4rpx;
	
}
.shiming button{
	width: 124rpx;
	height: 46rpx;
	background-color: #ffffff;
	border-radius: 23rpx;
	border: solid 1rpx #fd4259;
	line-height: 46rpx;
	text-align: center;
}
.zuqi{
	border-bottom: 1px dashed #bbbbbb;
	padding-bottom: 20rpx;
}
.xiaofei_box{
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.xiaofei_box image{
	width: 248rpx;
	height: 45rpx;
}
.add_danhao_dizh{
	border-top:10rpx solid #f0f2f5 ;
	padding: 30rpx 30rpx 0;
}
.add_danhao_dizh view{
	margin-bottom: 20rpx;
}
.tan_login{
	width: 600rpx;
	text-align: center;
	box-sizing: border-box;
}

.tan_login_tishi{
	text-align: center;
	line-height: 130rpx;
}
.tan_login_bottom{
	text-align: center;
}
.tan_login_bottom button{
	width: 467rpx;
	height: 80rpx;
	line-height: 80rpx;
	border-radius: 40rpx;
	margin: 0 auto;
}
.tan_login_logo image{
	width: 124rpx;
	height: 124rpx;
	border: 4rpx solid #ffffff;
	margin-top: -62rpx;
	border-radius: 100%;
	vertical-align: bottom;
	margin-bottom: 30rpx;
}
.tan_login_close image{
	width: 60rpx;
	height: 60rpx;
	margin-top: 60rpx;
}
.tan_login_box{
	height: 420rpx;
	background-color: #ffffff;
	border-radius: 34rpx;
}
.disabled_active{
    background-color: #999 !important;
}
.popup_qian{
	background-color: #ffffff;
	width: 650rpx;
}
.popup_qian_bottom{
	height: 100rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	border-top: 1px dashed #e5e5e5;
}
.popup_qian_bottom text{
	text-align: center;
}
.daoqi{
	margin-top: 10rpx;
}
.buchong{
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 86rpx;
	border-bottom: 1px dashed #bbbbbb;
}
.buchong_go{
	width: 140rpx;
	height: 50rpx;
	background-color: #ffffff;
	border-radius: 25rpx;
	border: solid 1rpx #fd4259;
	line-height: 50rpx;
	text-align: center;
}
</style>
